package cn.tedu.context;

import cn.tedu.demo.Demo;
import cn.tedu.demo.DemoLogger;
import cn.tedu.demo.Student;
import org.springframework.context.annotation.*;

@Configuration
@ComponentScan(basePackages = "cn.tedu.demo")
@Import({cn.tedu.sys.SysConfig.class})
public class Config {
    @Bean
    public Demo bean() {
        return new Demo();
    }

    @Bean(initMethod = "open", destroyMethod = "close")
    @Scope("prototype")
    public DemoLogger demoLogger() {
        return new DemoLogger();
    }
    @Bean
    @Lazy
    public Student student(){
        return new Student();
    }

}
